package com.demo.main.listener;

import com.demo.main.utils.CommonUtil;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import static com.demo.main.utils.ServletUtil.API_PATH;
public class GlobalDataListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        ServletContext context = sce.getServletContext();
        context.setAttribute("PROJECT_NAME", CommonUtil.PROJECT_NAME);
        context.setAttribute("API_PATH", API_PATH);
    }
    @Override
    public void contextDestroyed(ServletContextEvent sce) {
    }
}
